package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.csu.mypetstore.domain.Sequence;
import org.springframework.stereotype.Repository;

@Repository
public interface SequenceMapper {
    @Select("SELECT name, nextid\n" +
            "    FROM SEQUENCE\n" +
            "    WHERE NAME = #{name}")
    Sequence getSequence(Sequence sequence);
    @Update("UPDATE SEQUENCE\n" +
            "    SET NEXTID = #{nextId}\n" +
            "    WHERE NAME = #{name}")
    void updateSequence(Sequence sequence);
}
